﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace memcached
{
    /// <summary>
    /// Contains item value along with compare-and-store value.
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public sealed class CasValue<T>
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="value">not null</param>
        /// <param name="cas"></param>
        [System.Diagnostics.DebuggerHidden]
        public CasValue(T value, ulong cas)
        {
            Value = value;
            CAS = cas;
        }

        /// <summary>
        /// Not null.
        /// </summary>
        public T Value { get; private set; }

        /// <summary>
        /// Value version as in cache store.
        /// </summary>
        public ulong CAS { get; private set; }
    }
}